<?php
declare (strict_types = 1);

namespace app\command;

use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;
use think\facade\Cache;

class RedisClusterTest extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('redis_cluster_test')
            ->setDescription('the app\command\redisclustertest command');
    }

    protected function execute(Input $input, Output $output)
    {
        /*$cluster = new \RedisCluster(null, [
            '127.0.0.1:6380',
            '127.0.0.1:6381',
            '127.0.0.1:6382',
            '127.0.0.1:6383',
            '127.0.0.1:6384',
            '127.0.0.1:6385',
        ]);*/

        $redis = Cache::store('redis');
        while (true) {
            //$cluster->set('name','wangwu',5);
            $redis->set('name', 'lisi');
        }
    }
}
